package cn.huiyunche.base.service.vo;

import org.jdom.Document;
import org.jdom.Element;

/**
 * 易宝返回xml实体
 *
 * @author hdy [Tuffy]
 */
public class YeepayBackXmlRequestVo {

    private Document xml = new Document(); // 根
    private String cmd = "cmd"; // 命令 单笔代付
    private String retCode = "ret_Code"; // 返回代码
    private String orderId = "order_Id"; // 商户订单号
    private String r1Code = "r1_Code"; // 见附录打款状态码
    private String errorMsg = "error_Msg"; // 描述没一个存在的问题的打款记录的错 误描述信息,以帮助迅速解决问题
    private String hmac = "hmac"; // 签名

    public YeepayBackXmlRequestVo() {
    }

    public YeepayBackXmlRequestVo(Document xml) {
        this.xml = xml;
    }

    public Element getCmd() {
        return this.getDataElement().getChild(this.cmd);
    }

    public Element getRetCode() {
        return this.getDataElement().getChild(this.retCode);
    }

    public Element getOrderId() {
        return this.getDataElement().getChild(this.orderId);
    }

    public Element getR1Code() {
        return this.getDataElement().getChild(this.r1Code);
    }

    public Element getErrorMsg() {
        return this.getDataElement().getChild(this.errorMsg);
    }

    public Element getHmac() {
        return this.getDataElement().getChild(this.hmac);
    }

    private Element getDataElement() {
        return xml.getRootElement();
    }
}
